<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title><?=$_title ? $_title . " - ": '' ?>胖洋葱自己的博客</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

    <!-- bootstrap & fontawesome -->
    <link rel="stylesheet" href="<?=STATIC_URL?>/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="<?=STATIC_URL?>/bootstrap/css/font-awesome.css" />
    <link rel="stylesheet" href="<?=STATIC_URL?>/bootstrap/css/bootstrap-datetimepicker.css" />

    <!-- page specific plugin styles -->

    <!-- text fonts -->
    <link rel="stylesheet" href="<?=STATIC_URL?>/bootstrap/css/ace-fonts.css" />

    <!-- ace styles -->
    <link rel="stylesheet" href="<?=STATIC_URL?>/bootstrap/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="<?=STATIC_URL?>/bootstrap/css/ace-part2.min.css" class="ace-main-stylesheet" />
    <![endif]-->

    <!--[if lte IE 9]>
    <link rel="stylesheet" href="<?=STATIC_URL?>/bootstrap/css/ace-ie.css" />
    <![endif]-->

    <!-- common style for admin -->
    <link rel="stylesheet" href="<?=STATIC_URL?>/css/style.css" />
    <!-- inline styles related to this page -->
    <?php if (isset($pageCss)) { ?>
        <link rel="stylesheet" href="<?=STATIC_URL?>/css/<?=$pageCss?>.css" />
    <?php } ?>

    <!-- ace settings handler -->
    <script src="<?=STATIC_URL?>/bootstrap/js/ace-extra.js"></script>

    <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

    <!--[if lte IE 8]>
    <script src="<?=STATIC_URL?>/bootstrap/js/html5shiv.js"></script>
    <script src="<?=STATIC_URL?>/bootstrap/js/respond.js"></script>
    <![endif]-->

    <!-- basic scripts -->

    <!--[if !IE]> -->
    <script type="text/javascript">
        window.jQuery || document.write("<script src='<?=STATIC_URL?>/bootstrap/js/jquery.js'>"+"<"+"/script>");
    </script>

    <!-- <![endif]-->

    <!--[if IE]>
    <script type="text/javascript">
        window.jQuery || document.write("<script src='<?=STATIC_URL?>/bootstrap/js/jquery1x.js'>"+"<"+"/script>");
    </script>
    <![endif]-->
    <script type="text/javascript">
        if('ontouchstart' in document.documentElement) document.write("<script src='<?=STATIC_URL?>/bootstrap/js/jquery.mobile.custom.js'>"+"<"+"/script>");
    </script>
    <script src="<?=STATIC_URL?>/bootstrap/js/bootstrap.min.js"></script>
    <!--    <script src="./assets/bootstrap.js"></script>-->
    <link rel="icon" href="favicon.ico" type="image/x-icon">
</head>
<body class="no-skin" style="background-color: #ffffff;">
<!-- #section:basics/navbar.layout -->
<div id="navbar" class="navbar navbar-default">
    <script type="text/javascript">
        try{ace.settings.check('navbar' , 'fixed')}catch(e){}
    </script>

    <div class="navbar-container" id="navbar-container">
        <button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler" data-target="#sidebar">
            <span class="sr-only">Toggle sidebar</span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>

            <span class="icon-bar"></span>
        </button>

        <div class="navbar-header pull-left">
            <a href="#" class="navbar-brand">
                <small>
                    <i class="ace-icon fa fa-leaf green"></i>
                    胖洋葱自己的博客
                </small>
            </a>
        </div>

        <div class="navbar-buttons navbar-header pull-right" role="navigation">
            <ul class="nav ace-nav">

                <li class="light-blue">
                    <!-- Single button -->
                    <div class="btn-group">
                        <button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            Welcome, <?=$user['real_name']?> <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-right">
                            <li><a href="/index/resetpwd">修改密码</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="/login/logout">退出</a></li>
                        </ul>
                    </div>
                </li>

            </ul>
        </div>

    </div>
</div>
<div id="sidebar" class="sidebar responsive">
    <script type="text/javascript">
        try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
    </script>


    <ul class="nav nav-list">
        <?php
        foreach ($navMenu as $key=>$nav) {
            if ($nav['level'] == 2) {
                $tab_active = '';
                $pre_str = '';
                $mid_str = '';
                $str = '';
                $hasItem = false;
                foreach ($nav['labels'] as $val) {
                    $isShow = 1;

                    $active = 'highlight';
                    if ($pageId == $val['id']) {
                        $active = 'active highlight';
                        $tab_active = 'active highlight open';
                    }

                    $mid_str .= "<li class='" . $active . "'>
                        <a href='" . $val['href'] . "'>
                            <i class='menu-icon fa " . $val['class'] . "'></i>
                            " . $val['label'] . "
                        </a>
                        <b class='arrow'></b>
                    </li>";
                    $hasItem = true;
                }

                if ($hasItem) {
                    $pre_str = "<li class='" . $tab_active . "'>
                    <a href='#' class='dropdown-toggle'>
                        <i class='menu-icon fa " . $nav['class'] . "'></i>
                        <span class='menu-text'>" . $nav['label'] . "</span>
                        <b class='arrow fa fa-angle-down'></b>
                    </a>
                    <b class='arrow'></b>
                  <ul class='submenu'>";
                    $str = $pre_str . $mid_str . "</ul></li>";
                }

            } else {
                $str = '';
                $active = 'highlight';
                if ($pageId == $nav['id']) {
                    $active = 'active highlight';
                }

                $str = "<li class='{$active}'>
                <a href='" . $nav['href'] . "'>
                    <i class='menu-icon fa " . $nav['class'] . "'></i>
                    <span class='menu-text'>" . $nav['label'] . "</span>
                </a>
                <b class='arrow'></b>
                </li>";
            }
            echo $str;
        }
        ?>
    </ul><!-- /.nav-list -->

    <!-- #section:basics/sidebar.layout.minimize -->
    <div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
        <i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
    </div>

    <!-- /section:basics/sidebar.layout.minimize -->
    <script type="text/javascript">
        try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
    </script>
</div>
<div class="main-content">